package com.sukaiyi.giteejavaapi.common;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.List;
import java.util.Map;

/**
 * @author sukaiyi
 * @date 2020/06/28
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
public class HttpEndpoint {

    private String name;
    private HttpMethod method;
    private String url;
    private List<Param> params;
    private Map<String, String> headers;
    private String description;

    public enum HttpMethod {
        GET, PUT, POST, DELETE, PATCH
    }

    @Data
    @NoArgsConstructor
    @AllArgsConstructor
    public static class Param {
        private String name;
        private String description;
        private ParamDataType dataType;
        private ParamType type;
    }

    public enum ParamDataType {
        STRING, INTEGER, BOOLEAN, OBJECT, ARRAY,
    }

    public enum ParamType {
        QUERY, PATH, FORMDATA, BODY
    }

}
